<include file="../header" />
<body class="J_scroll_fixed">

    <script>

        $(document).ready(function () {

            $('input#datetime').click(function () {
                var courseId = $('input[name=courseId]').val();
                var day = $(this).attr("day");
                var clock = $(this).attr("name");
                layer.open({
                    type: 2,
                    title: '预约教练管理',
                    maxmin: false,
                    shadeClose: true, //点击遮罩关闭层
                    area: ['98%', '98%'],
                    content: "{:U('vip/bookCoach')}&day=" + day + "&clock=" + clock + "&courseId=" + courseId,
                    cancel: function(index){
                        window.location.reload();
                    }

                });
            });

        });

    </script>
        
    <div class="wrap jj">
        <input name='courseId' value='{$course.course_id}' type='hidden'/>
        
        <table class="table table-hover table-bordered">
            <thead>
                <tr>
                    <th>日期</th>
                    <th>时间安排</th>       
                </tr>
            </thead>
            <tbody>
            <volist name="coachWeekTime" id="vo">
                <tr>
                    <td width='20%'>
                        {$vo.day.id}<br/>
                        {$vo.day.week}
                    </td>
                    <td>           
                    <volist name="vo.bookindTimes" id="v" mod='5'> 
                        <if condition=" $v['is_today'] eq $isToday['BEFORE']" >
                            <if condition=" $v['time_manager_status'] eq $timeManagerStatus['ORDER']" >
                                <input id='datetime' value="{$v['name']}" type="button" name="{$v['id']}" day="{$vo['day']['id']}" class='btn' disabled="true"/>
                                <else/>
                                <input id='datetime' value="{$v['name']}" type="button" name="{$v['id']}" day="{$vo['day']['id']}"  disabled="true"/>
                            </if>   
                        <else/>

                            <if condition=" $v['time_manager_status'] eq $timeManagerStatus['ORDER']" >
                                <input id='datetime' value="{$v['name']}" type="button" name="{$v['id']}" day="{$vo['day']['id']}" class='btn' disabled="true"/>
                            <elseif condition=" $v['time_manager_status'] eq $timeManagerStatus['BAN']"/>
                                <input id='datetime' value="{$v['name']}" type="button" name="{$v['id']}" day="{$vo['day']['id']}"  disabled="true"/>
                            <elseif condition=" $v['time_manager_status'] eq $timeManagerStatus['ALLOW']"/>
                                <input id='datetime' value="{$v['name']}" type="button" name="{$v['id']}" day="{$vo['day']['id']}" />
                            </if>
                        </if>      
                        <eq name='mod' value='4'><br/></eq>
                    </volist>
                </td>
                </tr>        
            </volist>
            </tbody>
        </table>

    </div>
    <script src="__ROOT__/statics/js/common.js"></script>
</body>
</html>